﻿using System.Collections.Generic;
using System.Linq;
using System.Text;

using FanaticToy.UI;
using FanaticToy.UI.ViewModels;

namespace FanaticToy.CommandCore
{
    internal class Navigation
    {
        public void Execute()
        {
            var list = ThisSingleton.ThisAddIn.GetNagivateResultList();
            var formatlist = new List<LayerMetaDataViewModel>();
            var sb = new StringBuilder();
            if (list == null) return;
            if (list.Count() == 0) return;

            foreach (var item in list)
            {
                sb.AppendLine($"{item.Key}, {item.Value}");
                var viewmodel = new LayerMetaDataViewModel(item.Key, item.Value);
                formatlist.Add(viewmodel);
            }

            var win = new NavWindow();
            win.PART_ListBox.ItemsSource = formatlist;

            win.ShowDialog();
        }
    }
}
